{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "cultural-muslim",
   "metadata": {},
   "source": [
    "# Auto Encoder Architecture"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "light-audience",
   "metadata": {},
   "source": [
    "## Should I design my AE's decoder to be symmetry to its encoder?\n",
    "\n",
    "An AE’s encoder and decoder will not need to be symmetric in terms of structure. However, symmetric model structures work well in practice, so it’s usually preferable to non-symmetric design.\n",
    "\n",
    "So the answer: Yes, no, maybe. It depends on how well your model is performing, which ultimately is down to experiments."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "hawaiian-brother",
   "metadata": {},
   "source": [
    "## How to take an AE and say: this part is the encoder, and this part is the decoder?\n",
    "\n",
    "Usually the layer in AE with the smallest dimension is its latent. Encoders encodes inputs into latents, and decoder decodes latents into outputs.\n",
    "\n",
    "It helps to think in terms of information flowing through the network. Take a look at all auto-encoders. They usually consist of layers that scale down the input (encoder) and layers scaling up the input (decoders). Suppose that no information is lost (the decoder decodes the image perfectly), then the latent (vector created during the pass through the model) with the lowest dimension is most densely-packed with information, therefore, the best latent."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "official-benefit",
   "metadata": {},
   "source": [
    "## Can we share latent between different decoders (maybe of different architecture)?\n",
    "\n",
    "Yes but no. It is feasible, but no-one does that.\n",
    "\n",
    "If you really want to do it, you can simply train a new decoder that maps the latent to an image in a supervised manner. But wait! There is already the original decoder that is trained in the same way. So why bother training a new model like that?"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
